import { Vec3 } from "cc";
import { ecs } from "db://app-game/libs/ecs/ECS";

/** 流动移动 */
@ecs.register("FlowMoveModel")
export class FlowMoveModelComp extends ecs.Comp {
  /** 移动节点 */
  node: Node = null!;
  /** 移动方向 */
  velocity: Vec3 = new Vec3();
  /** 移动速度 */
  speed: number = 0;
  /** 偏移距离 */
  offset: number = 0;
  /** 移动完成回调 */
  moveCallback: Function | null = null;
  reset(entity: ecs.Entity): void {
    this.node = null!;
    this.velocity = new Vec3();
    this.speed = 0;
    this.offset = 0;
    this.moveCallback = null!;
  }
}
